// app/(dashboard)/@modal/edit-user/page.tsx - 悬浮面板页面
'use client';
import { Card, Button, Form, Input } from 'antd';
import { useRouter } from 'next/navigation';

export default function EditUserModal() {
    const router = useRouter();
    const [form] = Form.useForm();

    const handleCancel = () => {
        // 关闭悬浮面板（路由回退）
        router.back();
    };

    return (
        <div style={{
            position: 'absolute',
            top: '50%',
            left: '50%',
            transform: 'translate(-50%, -50%)',
            width: 500,
            pointerEvents: 'auto'
        }}>
            <Card title="编辑用户" footer={[
                <Button key="cancel" onClick={handleCancel}>取消</Button>,
                <Button key="save" type="primary" htmlType="submit" form="editForm">保存</Button>
            ]}>
                <Form id="editForm" form={form} layout="vertical">
                    <Form.Item name="name" label="姓名" rules={[{ required: true }]}>
                        <Input />
                    </Form.Item>
                    <Form.Item name="email" label="邮箱" rules={[{ type: 'email', required: true }]}>
                        <Input />
                    </Form.Item>
                </Form>
            </Card>
        </div>
    );
}